<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html>
    <head>
        <%@include file="../common/head.jspf" %>
    </head>

    <body class="fund-page sb-l-o sb-r-c" data-menu="#menu_crowdFund" data-list="#li_crowdFund">

        <!-- 主体内容开始 -->
        <div id="main">

            <!--侧边导航栏-->
            <%@include file="../common/sidebar.jspf" %>

            <!-- Start: Content-Wrapper -->
            <section id="content_wrapper">

                <!-- 顶部导航 -->
                <header id="topbar">
                    <div class="topbar-left">
                        <ol class="breadcrumb">
                            <li class="crumb-active">
                                <span>软擎科技</span>
                            </li>
                            <li class="crumb-icon">
                                <a href="dashboard"><span class="glyphicon glyphicon-home"></span></a>
                            </li>
                            <!-- 当前页 -->
                            <li class="crumb-trail">积分夺宝</li>
                        </ol>
                    </div>
                    <div class="topbar-right">
                        <!-- 登录信息 -->
                        <%@include file="../common/session.jspf" %>
                    </div>
                </header>
                <!-- 顶部导航结束 -->

                <!-- 页面内容开始 -->
                <section id="content">
                    <div class="btn-group ib mr10">
                        <a href="javacript:void(0)" class="btn btn-system light pull-right" id="crowdFundAdd"><span class="glyphicons glyphicons-magic mr10"></span>创建夺宝活动</a>
                    </div>
                    <hr class="br-light mt10 mb10">
                    <!--投标记录-->
                    <div class="panel-body pn bg-white">
                        <table class="table table-striped table-hover table-text-center" id="crowdFundList" cellspacing="0" width="100%">
                            <thead>
                                <tr>
                                    <th></th>
                                    <th>期数</th>
                                    <th>商品名称</th>
                                    <th>所需积分</th>
                                    <th>获奖者</th>
                                    <th>备注</th>
                                    <th>是否默认</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody id="tbody"></tbody>
                        </table>
                    </div>
                </section>
                <!-- 页面内容结束 -->

            </section>
        </div>

        <%@include file="../loan/modal/processing.jspf" %>

        <!--操作菜单模板-->
        <div id="operationHTML" class="hidden">
            <div class="btn-group">
                <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-expanded="true"><i class="glyphicon glyphicon-wrench mr5"></i>操作
                    <span class="caret ml5"></span>
                </button>
                <ul class="dropdown-menu pull-right" role="menu">
                    <li class="editLink">
                        <a onclick="return setDefault('#id');"><span class="glyphicons glyphicons-edit mr5"></span>默认活动</a>	
                    </li>
                    <li class="downloadLink">
                        <a onclick="return show('#id');"><span class="glyphicons glyphicons-download_alt mr5"></span>编辑</a>
                    </li>
                </ul>
            </div>
        </div>
        <div class="modal fade" id="myModal" tabindex="-1" role="dialog">
            <div class="record" style="height: 280px">
                <form id="recordForm" method="POST">
                    <input type="hidden" id="crowdFundId" value=""/>
                    <ul>
                        <li><b>添加积分夺宝活动</b></li>
                        <li><span>期数：</span>
                            <span>
                                <input type="text" id="period" style="line-height: normal"/>
                            </span>
                        </li>
                        <li><span>选择商品：</span>
                            <span>
                                <select id="commotity" class="form-control h-30" style="width: inherit;">
                                </select> 
                            </span>
                        </li>
                        <li>
                            <span>所需积分：</span>
                            <span><input type="text" id="sumPoint" style="line-height: normal"/></span>
                        </li>
                        <li>
                            <span>备注：</span>
                            <span><input type="text" id="remark" style="line-height: normal"/></span>
                        </li>
                        <li>
                            <span></span>
                            <span><label><input type="checkbox" id="isDefault" value="true" style="width: 20px;"/>默认活动</label></span>
                        </li>
                        <li>
                            <input class="btn btn-sm pt4 pb4 btn-system" data-dismiss="modal" id="cancel" value="取消"/>
                            <input class="btn btn-sm pt4 pb4 btn-system" type="button" id="confirm" value="确认"/>
                        </li>
                    </ul>
                </form>
            </div>
        </div>
        <script type="text/x-tmpl-mustache" id="crowdTemplate">
            <table class="table table-striped table-text-center">
                <thead>
                    <tr>
                        <th>用户</th>
                        <th>人次</th>
                        <th>号段</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    {{#placements}}
                    <tr class="message-read">
                        <td><a target="_blank" href="user/index/{{userId}}">{{loginName}}</a></td>
                        <td>{{num}}</td>
                        <td>{{sno}}</td>
                        <td>
                            {{#isAllot}}
                             <div class="btn-group mr10">                                 
                                <button class="btn btn-system btn-xs edit" data-tid="{{id}}"  data-uid="{{userId}}" data-pointId="{{pointId}}">设为中奖者</button>			   
                            </div>
                            {{/isAllot}}
                        </td>
                    </tr>
                    {{/placements}}
                </tbody>
            </table>
        </script>Ï
        <%@include file="../common/scripts.jspf" %>
        <script type="text/javascript" src="${rootPath}/js/pages/pointsystem/crowdFund.js"></script>
    </body>
</html>
